package com.legal.aid.system.service.impl;

import java.util.List;
import com.legal.aid.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.legal.aid.system.mapper.LawRegulationMapper;
import com.legal.aid.system.domain.LawRegulation;
import com.legal.aid.system.service.ILawRegulationService;

/**
 * 法律法规Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-27
 */
@Service
public class LawRegulationServiceImpl implements ILawRegulationService 
{
    @Autowired
    private LawRegulationMapper lawRegulationMapper;

    /**
     * 查询法律法规
     * 
     * @param lawId 法律法规主键
     * @return 法律法规
     */
    @Override
    public LawRegulation selectLawRegulationByLawId(Long lawId)
    {
        return lawRegulationMapper.selectLawRegulationByLawId(lawId);
    }

    /**
     * 查询法律法规列表
     * 
     * @param lawRegulation 法律法规
     * @return 法律法规
     */
    @Override
    public List<LawRegulation> selectLawRegulationList(LawRegulation lawRegulation)
    {
        return lawRegulationMapper.selectLawRegulationList(lawRegulation);
    }

    /**
     * 新增法律法规
     * 
     * @param lawRegulation 法律法规
     * @return 结果
     */
    @Override
    public int insertLawRegulation(LawRegulation lawRegulation)
    {
        lawRegulation.setCreateTime(DateUtils.getNowDate());
        return lawRegulationMapper.insertLawRegulation(lawRegulation);
    }

    /**
     * 修改法律法规
     * 
     * @param lawRegulation 法律法规
     * @return 结果
     */
    @Override
    public int updateLawRegulation(LawRegulation lawRegulation)
    {
        lawRegulation.setUpdateTime(DateUtils.getNowDate());
        return lawRegulationMapper.updateLawRegulation(lawRegulation);
    }

    /**
     * 批量删除法律法规
     * 
     * @param lawIds 需要删除的法律法规主键
     * @return 结果
     */
    @Override
    public int deleteLawRegulationByLawIds(Long[] lawIds)
    {
        return lawRegulationMapper.deleteLawRegulationByLawIds(lawIds);
    }

    /**
     * 删除法律法规信息
     * 
     * @param lawId 法律法规主键
     * @return 结果
     */
    @Override
    public int deleteLawRegulationByLawId(Long lawId)
    {
        return lawRegulationMapper.deleteLawRegulationByLawId(lawId);
    }
}
